<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function factorial(){
            var result=1;
            for (var i = 1; i <= 10; i++) {
                result*=i;
            }
            alert(result);
        }

        function shopping(){
            //公鸡5块 母鸡3块 小鸡1块3只
            for (var i = 0; i < 21; i++) {
                for (var j = 0 ; j < 34 ;j++){
                    if ((100-(i*5)-(j*3))*3 + i + j==100){
                        document.getElementById("way").innerHTML += "公鸡"+i+" "+"母鸡"+j+" "+"小鸡"+(100-i-j)+"<br/>";
                    }
                }
            }
        }
    </script>
</head>
<body>
    <input type="button" value="10的阶乘" onclick="factorial()">
    <input type="button" value="百钱买百鸡" onclick="shopping()">
    <div id="way"></div>
</body>
</html>